import { axios } from '@/utils/request'
const prefix = '/supplier/mdmSupplier'
// const prefix = '/supplier/mdmSupplier'


/**
 * 高级查询
 * @param params
 * @returns {AxiosPromise}
 */
export function superPageFetchList (params) {
  return axios({
    url: prefix + '/list',
    method: 'GET',
    params: {
      ...params
    }
  })
}


/**
 * 新增
 * @param params
 * @returns {AxiosPromise}
 */
export function addObj (params) {
  return axios({
    url: prefix + '/add',
    method: 'POST',
    data: {
      ...params
    }
  })
}

/**
 * 删除
 * @param id
 * @returns {AxiosPromise}
 */
export function delObj (id) {
  return axios({
    url: prefix + '/deleteById/'+id,
    method: 'DELETE'
  })
}

/**
 * 获取详情
 * @param id
 * @returns {AxiosPromise}
 */
export function getObj () {
  return axios({
    url: prefix +'/list',
    method: 'GET'
  })
}


/**
 * 修改
 * @param params
 * @returns {AxiosPromise}
 */
export function putObj (params) {
  return axios({
    url: prefix + '/put',
    method: 'PUT',
    data: {
      ...params
    }
  })
}

/**
 * 下载模板
 * @returns {AxiosPromise}
 */
export function downloadExcelCandidate() {
  return axios({
    url: prefix +'/downloadExcel',
    method: 'get',
    responseType: 'arraybuffer'
  })
}